const KPIDimMap = {
  fiveMins: 1,//5分钟;
  halfHour: 2,//半小时
  oneHour: 3,//小时;
  day: 4,//日
  week: 5,//周
  month:6,//月
  year: 7 //年
}

/**
 * KPI 时间粒度
 */
class KPIDim {
  constructor(type) {
    this.type = type;
  }
  set type(type) {
    this._type = type;
    this.name = this.setUpName(this._type);
  }
  get type()
  {
    return this._type;
  }
   setUpName(type) {
     switch (type) {
      case KPIDimMap.fiveMins:
        return '5分钟';
      case KPIDimMap.halfHour:
        return '半小时';
      case KPIDimMap.oneHour:
        return '小时';
      case KPIDimMap.day:
        return '天';
      case KPIDimMap.week:
        return '周';
      case KPIDimMap.month:
        return '月';
       case KPIDimMap.year:
         return '年'
    }
    return '';
  }
}
module.exports = {
  KPIDim: KPIDim,
  KPIDimMap: KPIDimMap
}